import React from 'react'
import { history } from "umi"
import { Breadcrumb } from 'antd';
// const history = useHistory()
const data = [
    { path: "/", name: '首页' },
    { path: "/home/management", name: '管理员模块' },
    { path: "/home/banner", name: '轮播图管理' },
    { path: "/home/menu", name: '菜谱管理' },
    { path: "/home/vip", name: '会员管理' },
    { path: "/home/combo", name: '套餐管理' }
]
export default function breadnav() {
    let nowpath = history.location.pathname
    if (nowpath == "/home") {
        nowpath = "/"
    }
    const nameone = data.filter(item => item.path == nowpath)
    return (
        <>
            <div style={{width:"98.5%",padding:'10px 20px',backgroundColor:"#ffffff",margin:'10px 0'}}>
                <Breadcrumb>
                    <Breadcrumb.Item>
                        <a href={nowpath} style={{color:'#ffa39e',fontWeight:'bold'}}>{nameone[0].name}</a>
                    </Breadcrumb.Item>
                </Breadcrumb>
            </div>

        </>
    )
}
